home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / hypercar / xfcn / spttool.cpt / Support Tools eXternals 1.2.5 / card_32219.txt < prev    next >
Text File  |  1990-11-13  |  5KB  |  197 lines

  1. -- card: 32219 from stack: in.5
  2. -- bmap block id: 41936
  3. -- flags: 0000
  4. -- background id: 3858
  5. -- name: DocumentCreator
  6. ----- HyperTalk script -----
  7. on OpenCard
  8.   put thisVolumePath() into cd fld "volume"
  9.   pass OpenCard
  10. end OpenCard
  11.  
  12. on CloseCard
  13.   put empty into cd fld "volume"
  14.   pass CloseCard
  15. end CloseCard
  16.  
  17. on hideObjects
  18.   hide cd btn "Try It!"
  19.   hide cd btn "choose"
  20.   hide cd btn "creator popup"
  21.   hide cd fld "volume"
  22.   hide cd fld "creator"
  23.   hide cd fld "label"
  24.   hide cd fld "label 2"
  25. end hideObjects
  26.  
  27. on showObjects
  28.   show cd btn "Try It!"
  29.   show cd btn "choose"
  30.   show cd btn "creator popup"
  31.   show cd fld "volume"
  32.   show cd fld "creator"
  33.   show cd fld "label"
  34.   show cd fld "label 2"
  35. end showObjects
  36.  
  37.  
  38. -- part 1 (button)
  39. -- low flags: 00
  40. -- high flags: 0000
  41. -- rect: left=207 top=159 right=181 bottom=236
  42. -- title width / last selected line: 0
  43. -- icon id / first selected line: 12030 / 12030
  44. -- text alignment: 1
  45. -- font id: 0
  46. -- text size: 12
  47. -- style flags: 0
  48. -- line height: 16
  49. -- part name: creator popup
  50. ----- HyperTalk script -----
  51. on mousedown
  52.   put item 3 of rect of the target - 5 into horiz
  53.   put 20  into vert
  54.   put "MSWD;MACA;nX^n;" & "-\d;EDIT;QED1;McSk;" & "-\d;GEOL;zTRM;DFB0;NavC;" & "-\d;WILD;RUNT;" & "-\d;PJMM;MPS ;" & "-\d;XCEL" into menuTxt
  55.   get wavesHPopUp(-1,0,menuTxt, vert, horiz)
  56.   if line 1 of it is not empty then
  57.     put char 1 to 4 of line 1 of it into cd fld "Creator"
  58.     set the hilite of me to false
  59.   end if
  60. end mousedown
  61.  
  62.  
  63.  
  64.  
  65. -- part 2 (field)
  66. -- low flags: 00
  67. -- high flags: 0002
  68. -- rect: left=123 top=159 right=179 bottom=199
  69. -- title width / last selected line: 0
  70. -- icon id / first selected line: 0 / 0
  71. -- text alignment: 0
  72. -- font id: 3
  73. -- text size: 12
  74. -- style flags: 256
  75. -- line height: 16
  76. -- part name: Creator
  77.  
  78.  
  79. -- part 4 (field)
  80. -- low flags: 00
  81. -- high flags: 0002
  82. -- rect: left=80 top=192 right=212 bottom=199
  83. -- title width / last selected line: 0
  84. -- icon id / first selected line: 0 / 0
  85. -- text alignment: 0
  86. -- font id: 3
  87. -- text size: 12
  88. -- style flags: 256
  89. -- line height: 16
  90. -- part name: volume
  91.  
  92.  
  93. -- part 5 (button)
  94. -- low flags: 00
  95. -- high flags: A004
  96. -- rect: left=205 top=192 right=211 bottom=252
  97. -- title width / last selected line: 0
  98. -- icon id / first selected line: 0 / 0
  99. -- text alignment: 1
  100. -- font id: 3
  101. -- text size: 12
  102. -- style flags: 0
  103. -- line height: 16
  104. -- part name: Choose
  105. ----- HyperTalk script -----
  106. on mouseUp
  107.   put volumePath() into newVolume
  108.   if newVolume Γëá empty then put newVolume into cd fld "volume"
  109. end mouseUp
  110.  
  111.  
  112.  
  113. -- part 6 (field)
  114. -- low flags: 01
  115. -- high flags: 0000
  116. -- rect: left=63 top=163 right=180 bottom=114
  117. -- title width / last selected line: 0
  118. -- icon id / first selected line: 0 / 0
  119. -- text alignment: 65535
  120. -- font id: 3
  121. -- text size: 10
  122. -- style flags: 0
  123. -- line height: 13
  124. -- part name: label
  125.  
  126.  
  127. -- part 7 (field)
  128. -- low flags: 01
  129. -- high flags: 0000
  130. -- rect: left=25 top=195 right=212 bottom=76
  131. -- title width / last selected line: 0
  132. -- icon id / first selected line: 0 / 0
  133. -- text alignment: 65535
  134. -- font id: 3
  135. -- text size: 10
  136. -- style flags: 0
  137. -- line height: 13
  138. -- part name: label 2
  139.  
  140.  
  141. -- part 8 (button)
  142. -- low flags: 00
  143. -- high flags: A002
  144. -- rect: left=108 top=240 right=274 bottom=201
  145. -- title width / last selected line: 0
  146. -- icon id / first selected line: 0 / 0
  147. -- text alignment: 1
  148. -- font id: 0
  149. -- text size: 12
  150. -- style flags: 8192
  151. -- line height: 16
  152. -- part name: Try it!
  153. ----- HyperTalk script -----
  154. on mouseUp
  155.   global errGlobal
  156.   put DocumentCreator(cd fld "volume", cd fld "creator", "noDialog:errGlobal") into parentApp
  157.   if errGlobal = empty then
  158.     put "Files of type ΓÇ£" & cd fld "creator" & "ΓÇ¥ are created by" && parentApp
  159.   else
  160.     answer "Error: ΓÇ£" & errGlobal & "ΓÇ¥"
  161.     hide msg
  162.     put empty into errGlobal
  163.   end if
  164. end mouseUp
  165.  
  166.  
  167.  
  168.  
  169. -- part contents for background part 20
  170. ----- text -----
  171.      This XFCN takes a four character creator signature and looks through the desktop file on the specified volume for the name of the application which created it.  If no matches are found in the specified volume it looks throught the desktop file on each mounted volume.
  172.  
  173. To use this demo fill in both fields on the left, and click on the "Try It!" button.
  174.  
  175. Calling syntax : DocumentCreator(volName, creatorString, <"noDialog:"errorGlobal>)
  176.   VOLNAME: the path to the volume to search
  177.   CREATORSTRING: a four character file creator signature
  178.  
  179.      Portions of this code are taken from Dan Winkler's  "getCreator" XFCN.
  180.  
  181.  
  182. -- part contents for card part 2
  183. ----- text -----
  184. WILD
  185.  
  186. -- part contents for card part 6
  187. ----- text -----
  188. creator
  189.  
  190.  
  191. -- part contents for card part 7
  192. ----- text -----
  193. volume
  194.  
  195. -- part contents for background part 38
  196. ----- text -----
  197. 11/50